<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
		"http://www.w3.org/TR/html4/loose.dtd">
<!--
 *  This file is part of AtlasMapper server and clients.
 *
 *  Copyright (C) 2011 Australian Institute of Marine Science
 *
 *  Contact: Gael Lafond <g.lafond@aims.org.au>
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-->

<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<link rel="icon" type="image/png" href="../resources/favicon.png" />
		<title>Manual Override documentation</title>

		<style type="text/css">
			table {
				border-collapse: collapse;
				border: 1px solid #99BCE8;
				width: 100%;
			}
			table th, table td {
				vertical-align: top;
				padding: 0.2em;
			}
			table th {
				border: 1px solid #FFFFFF;
				background-color: #99BCE8;
			}
			table td {
				border: 1px solid #99BCE8;
			}
			table tr td.attr {
				font-family: "monospace";
				width: 300px;
			}
			table tr .type {
				width: 100px;
			}
		</style>
	</head>

	<body>
		<h1>Manual Override documentation</h1>
		<p>
			This field must respect the JSON syntax, a subset of JavaScript. If
			it contains errors, the form will refuse to submit. It always start
			with <b>{</b> and ends with <b>}</b>. To override an attribute of a
			layer, specified the layer ID following by a column <b>:</b> and the
			curly brackets <b>{</b> and <b>}</b>. Add the attributes inside the
			brackets.
		</p>
		<p>
			The attributes for a layer are build from the capabilities document,
			for WMS layers, after applying the manual overrides from the layer
			data source than the manual overrides from the client.
		</p>
		<h2>Examples</h2>
		<p>
			The following bloc override the attribute
			<i>wmsRequestMimeType</i> and <i>legendParameters</i> for the
			layer ID <i>ea:bluemarble</i> to request tiles and legend graphics as GIF:
		</p>
<pre>
{
	"ea:bluemarble": {
		"wmsRequestMimeType": "image/gif",
		"legendParameters": {
			"FORMAT": "image/gif"
		}
	}
}
</pre>

		<p>
			This example show how to deactivate the feature requests for the
			layer ID "ea:GBR_GBRMPA_GBR-features" and change the default style
			and change the title of an other one.
		</p>
<pre>
{
	"ea:GBR_GBRMPA_GBR-features": {
		"wmsQueryable": false,
		"styles": {
			"GBR-features_Reefs-outline-BW": {"default": true},
			"GBR-features_Baselayer": {
				"title": "GBR features for baselayer"
			}
		}
	}
}
</pre>

		<p>
			The next example show how to disable the legend for multiple layers.
			This feature is useful for layer groups serve by GeoServer since
			this server can't provide legend graphics for grouped layers.
		</p>
<pre>
{
	"GBR_JCU_Bathymetry-3DGBR_Land-and-sea": {"hasLegend": false},
	"World_NE2-coast-cities-reefs_Baselayer": {"hasLegend": false},
	"ea:World_NED_NE2": {"hasLegend": false}
}
</pre>

		<p>
			The following table show the layers attributes that can be specified:
		</p>

		<table>
			<tr>
				<th class="attr">Attribute</th>
				<th class="type">Type</th>
				<th class="desc">Description</th>
			</tr>
			<tr>
				<td class="attr">title</td>
				<td class="type">String</td>
				<td class="desc">The displayed name of the layer, shown in multiple location in the client.</td>
			</tr>
			<tr>
				<td class="attr">description</td>
				<td class="type">HTML String</td>
				<td class="desc">A HTML description of the layer, shown in the layer info panel of the client.</td>
			</tr>
			<tr>
				<td class="attr">dataSourceId</td>
				<td class="type">String</td>
				<td class="desc">The ID of the data source, as specified in the data source page. This field can be used to specified which URL to use to get the tiles, legend, feature requests, etc.</td>
			</tr>
			<tr>
				<td class="attr">layerBoundingBox</td> <!-- TODO Is this field work? -->
				<td class="type">Array of 4 decimal numbers</td>
				<td class="desc">The coordinate of the top-left corner and the bottom left corder of the layer. Those coordinates are used to locate the layer when the <i>Locate</i> button is pressed.</td>
			</tr>
			<tr>
				<td class="attr">wmsQueryable</td>
				<td class="type">Boolean</td>
				<td class="desc"><i>true</i> to allow a layer to receive WMS Feature requests, <i>false</i> otherwise.</td>
			</tr>
			<tr>
				<td class="attr">wmsVersion</td> <!-- TODO Is this field work? -->
				<td class="type">String</td>
				<td class="desc">The WMS version send in the request; "1.1.1", "1.3.0"</td>
			</tr>
			<tr>
				<td class="attr">isBaseLayer</td>
				<td class="type">Boolean</td>
				<td class="desc"><i>true</i> to make this layer a base layer, <i>false</i> otherwise. Note that it is better to use the <i>Base layers</i> field in the <i>Data sources</i> configuration page.</td>
			</tr>
			<tr>
				<td class="attr">hasLegend</td>
				<td class="type">Boolean</td>
				<td class="desc"><i>false</i> to disable the legend of this layer.</td>
			</tr>
			<tr>
				<td class="attr">legendUrl</td>
				<td class="type">URL</td>
				<td class="desc">URL to an image, to be use as a legend, to substitute the one provide by the server.</td>
			</tr>
			<tr>
				<td class="attr">legendGroup</td> <!-- TODO Is this field work? -->
				<td class="type">String</td>
				<td class="desc">Name of the group that will be use to group legend together, in the legend window.</td>
			</tr>
			<tr>
				<td class="attr">legendTitle</td>
				<td class="type">String</td>
				<td class="desc">Name of the layer, to be display in the legend window.</td>
			</tr>
			<tr>
				<td class="attr">infoHtmlUrls</td> <!-- TODO Is this field work? -->
				<td class="type">Array of URL</td>
				<td class="desc">URLs of documents that will be displayed in the Layer info panel.</td>
			</tr>
			<tr>
				<td class="attr">aliasIds</td> <!-- TODO Is this field still useful? -->
				<td class="type">Array of String</td>
				<td class="desc">List of IDs that can be used to refer to this layer.</td>
			</tr>
			<tr>
				<td class="attr">featureRequestsUrl</td>
				<td class="type">URL</td>
				<td class="desc">URL used to send the feature requests. Useful to redirect the feature requests of WebCache layers to a WMS server.</td>
			</tr>
			<tr>
				<td class="attr">serverUrls</td>
				<td class="type">Array of URL</td>
				<td class="desc">URL used to request the tiles. The application currently only support one URL. The first one only is used.</td>
			</tr>
			<tr>
				<td class="attr">webCacheUrl</td>
				<td class="type">URL</td>
				<td class="desc">URL of the server used to request the layer from a cache, when the URL only contains supported parameters.</td>
			</tr>
			<tr>
				<td class="attr">webCacheSupportedParameters</td>
				<td class="type">Array of String</td>
				<td class="desc">List of the parameters supported by the WebCache server.</td>
			</tr>
			<tr>
				<td class="attr">dataSourceName</td> <!-- TODO Is this field work? -->
				<td class="type">String</td>
				<td class="desc">Specified a different data source name for this layer, to display it in a different tab in the <i>Add layers</i> window.</td>
			</tr>
			<tr>
				<td class="attr">dataSourceType</td>
				<td class="type">String</td>
				<td class="desc">Override the type of layer. This option should not be used in normals circumstances.</td>
			</tr>
			<tr>
				<td class="attr">legendParameters</td>
				<td class="type">String</td>
				<td class="desc">String of pairs <i>parameter=value</i>, separated by coma. Those parameters are sent with the request for the legend graphic.</td>
			</tr>
			<tr>
				<td class="attr">wmsVersion</td> <!-- TODO Is this field work? -->
				<td class="type">String</td>
				<td class="desc">The WMS version send in the request; "1.1.1", "1.3.0"</td>
			</tr>
			<tr>
				<td class="attr">wmsRequestMimeType</td>
				<td class="type">Mime type</td>
				<td class="desc">Mime type used to request the tiles. Usualy <i>image/jpeg</i>, <i>image/png</i> or <i>image/gif</i></td>
			</tr>
			<tr>
				<td class="attr">wmsFeatureRequestLayers</td>
				<td class="type">Array of Layer ID</td>
				<td class="desc">List of layers to be request when a feature request is sent to this layer.</td>
			</tr>
			<!-- TODO Enable this when transectable will be implemented
			<tr>
				<td class="attr">wmsTransectable</td>
				<td class="type">Boolean</td>
				<td class="desc"><i>true</i> to allow the client to draw transect on this layer, <i>false</i> otherwise.</td>
			</tr>
			-->
			<tr>
				<td class="attr">default</td>
				<td class="type">Boolean</td>
				<td class="desc"><i>true</i> to load this layer when the client load, <i>false</i> otherwise. (default value: false)</td>
			</tr>
			<tr>
				<td class="attr">styles</td>
				<td class="type">JSON Object</td>
				<td class="desc">
					Define the styles of this layer.<br/>
					List of available options for styles:
					<table>
						<tr>
							<th class="attr">Attribute</th>
							<th class="type">Type</th>
							<th class="desc">Description</th>
						</tr>
						<tr>
							<td class="attr">title</td>
							<td class="type">String</td>
							<td class="desc">The displayed name for this style. It's shown in the dropdown list in the option panel of the layer.</td>
						</tr>
						<tr>
							<td class="attr">description</td>
							<td class="type">String</td>
							<td class="desc">A description for the layer. This field currently has no use in the AtlasMapper client.</td>
						</tr>
						<tr>
							<td class="attr">default</td>
							<td class="type">Boolean</td>
							<td class="desc"><i>true</i> to load this style by default when the layer is loaded, <i>false</i> otherwise. (default value: false)</td>
						</tr>
					</table>
					For more info, check the example above or the styles' definition for a layer in the file <i>layers.json</i>.
				</td>
			</tr>
			<tr>
				<td class="attr">options</td>
				<td class="type">Array of JSON Object</td>
				<td class="desc">
					Define extra options to be added in the options panel of this layer.<br/>
					Example:<br/>
<pre>
"ea:bluemarble" : {
	"options": [
		{
			"name": "comment",
			"title": "Comment",
			"type": "textarea"
		}
	]
}
</pre>
					<b>WARNING</b> this attribute is under development and may be unstable or change considerably between versions.<br/>
					List of available attributes for this field:
					<table>
						<tr>
							<td class="attr">name</td>
							<td class="type">String</td>
							<td class="desc">The parameter's name, added to the request.</td>
						</tr>
						<tr>
							<th class="attr">Attribute</th>
							<th class="type">Type</th>
							<th class="desc">Description</th>
						</tr>
						<tr>
							<td class="attr">title</td>
							<td class="type">String</td>
							<td class="desc">The displayed name for this option. It's shown as a label for the new input.</td>
						</tr>
						<tr>
							<td class="attr">type</td>
							<td class="type">String</td>
							<td class="desc">
								The ExtJS xtype for the input.<br/>
								List of available types:
								<ul>
									<li><b>checkbox</b></li>
									<li><b>combo</b>: for dropdown. Not supported yet.</li>
									<li><b>displayfield</b>: to display a readonly value.</li>
									<li><b>hidden</b>: to send a value to the server without showing it to the user.</li>
									<li><b>numberfield</b></li>
									<li><b>sliderfield</b></li>
									<li><b>textarea</b></li>
									<li><b>textfield</b></li>
									<li><b>timefield</b></li>
									<li><b>datefield</b>: For date in format d/m/Y</li>
									<li><b>ux-datefield</b>: For date displayed in format d/m/Y but sent to the server in format Y-m-d</li>
									<li><b>ux-ncdatetimefield</b>: For date and time displayed in format d/m/Y and saved in the ISO format expected by NCWMS server.</li>
									<li><b>ux-ncplotpanel</b>: To add time series and transect drawing features on NCWMS layers. NOTE: The <i>name</i> field is ignored with this type since it do not change the layer URL.</li>
								</ul>
							</td>
						</tr>
						<tr>
							<td class="attr">mandatory</td>
							<td class="type">Boolean</td>
							<td class="desc"><i>true</i> to force the user to fill the option with a value, <i>false</i> otherwise. (default value: <i>false</i>)</td>
						</tr>
						<tr>
							<td class="attr">defaultValue</td>
							<td class="type">String</td>
							<td class="desc">Value pre-entered in the field.</td>
						</tr>
					</table>
				</td>
			</tr>
			<tr>
				<td class="attr">selected</td>
				<td class="type">Boolean</td>
				<td class="desc">
					<i>false</i> to add the layer in the layer switcher but not on the map (visibility false) when loaded for the first time.<br/>
					<b>NOTE:</b> This is a temporary field that will be removed after the Save State feature has been developed.
				</td>
			</tr>
			<!-- styles & layerOptions: [name, type, mandatory, defaultValue] -->
		</table>
	</body>
</html>
